package com.itheima.day02;

/*
    使用三元运算符对三个数进行从小到大排序:
    int a = 10;
    int b = 20;
    int c = 15;

    输出结果:
        最小值: 10
        中间值: 15
        最大值: 20
 */
public class Demo3 {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        int c = 15;

        //1. 获取较大值
        int tempMax = a > b ? a : b;
        //2. 求出最大值
        int max = tempMax > c ? tempMax : c;

        //3. 获取较小值
        int tempMin = a < b ? a : b;
        //4. 求出最小值
        int min = tempMin < c ? tempMin : c;

        //5. 对三个数求和
        int sum = a + b + c;
        //6. 求出中间值
        int mid = sum - max - min;

        System.out.println("最小值: "+min);
        System.out.println("中间值: "+mid);
        System.out.println("最大值: "+max);

        boolean flag = true;
        if(flag){
            System.out.println("Hello");
        }else{

        }
    }
}
